import React, { memo } from 'react';
import { IResourceIconConfig } from './schema';
import styles from './index.less';

const ResourceIcon = memo((props: IResourceIconConfig) => {
  const { tooltip, iconType, fontSize } = props;
  return (
    <div className={styles.resourceIcon} title={tooltip}>
      <span
        className={`iconfont ${iconType || 'icon-tubiao'} ${styles.icon}`}
        style={{
          fontSize,
        }}
      ></span>
    </div>
  );
});

export default ResourceIcon;
